<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title><?php echo $this->_siteConfig->name;?></title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/jquery/jquery-1.12.4.min.js"></script>
	<script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/form/form.js"></script>
	<script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/autovalidate/validate.js"></script><link rel="stylesheet" type="text/css" href="/git/micarshop/runtime/_systemjs/autovalidate/style.css" />
	<script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/artdialog/artDialog.js"></script><script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/artdialog/plugins/iframeTools.js"></script><link rel="stylesheet" type="text/css" href="/git/micarshop/runtime/_systemjs/artdialog/skins/aero.css" />
	<script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/artTemplate/artTemplate.js"></script><script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/artTemplate/artTemplate-plugin.js"></script>
	<!--[if IE]><script src="<?php echo $this->getWebViewPath()."javascript/html5.js";?>"></script><![endif]-->
	<script src="<?php echo $this->getWebViewPath()."javascript/common.js";?>"></script>
	<script src='<?php echo $this->getWebViewPath()."javascript/site.js";?>'></script>
	<script type="text/javascript" src="<?php echo $this->getWebViewPath()."javascript/jquery-ui.min.js";?>"></script>
	<script type="text/javascript" src="<?php echo $this->getWebViewPath()."javascript/chat.js";?>"></script>
	<script type="text/javascript" src="http://code.jquery.com/jquery-migrate-1.0.0.js"></script>
	<link rel="stylesheet" href="<?php echo $this->getWebSkinPath()."style/style.css";?>">
	<link rel="stylesheet" href="<?php echo $this->getWebSkinPath()."style/chat.css";?>">
</head>
<body>
<?php $ava_img?>

<!-- 右边竖条  s-->
<div class="right">
	<span>在线联系</span>
	
	<?php if($this->user){?>
		<?php foreach($this->user as $k => $v){?>
			key:<?php echo isset($k)?$k:"";?>---value:<?php echo isset($v)?$v:"";?><br/>
		<?php }?>
		
		<?php $uid = $this->user['user_id']?>
		<?php $query = new IQuery("user");$query->where = "id = $uid";$items = $query->find(); foreach($items as $key => $first){?> 
			<?php $ava_img=$first['head_ico']?>
		<?php }?>
		<input class="self_id" type="hidden" value="<?php echo isset($this->user['user_id'])?$this->user['user_id']:"";?>"/>
		<input class="self_name" type="hidden" value="<?php echo isset($this->user['username'])?$this->user['username']:"";?>"/>
		<div class="message" id="showFriend" >
			<a href="javascript:"></a>
		</div>
		<?php }else{?>
		<input class="self_id" type="hidden" value=""/>
		<input class="self_name" type="hidden" value=""/>
		<div class="message" id="login">
			<a href="<?php echo IUrl::creatUrl("/simple/login");?>"></a>
		</div>	
	<?php }?>
		
	<script type="text/javascript">
		var user_ava = '<?php echo isset($this->user['head_ico'])?$this->user['head_ico']:"";?>';
	</script>
	
</div>

<!-- 右边竖条  e-->

<?php if($this->user){?>
<!-- 聊天窗口我好友列表   s -->
<div class="chat_list" >
	<div class="chat_top">
		<h1>
			<i></i>
			联系人
		</h1>
		<span class="close"></span>		
	</div>
	<?php $f_uid?> <!-- 对方的id -->
	<?php $nf_uid?>
	<!-- 好友列表 s -->
	<div class="chat_user">
		<dl class="chat_user_friend">
			<dt>
				我的好友
				<span class="show"></span>
			</dt>
			<!-- 查找好友表 -->
			<?php $query = new IQuery("friends");$query->where = "(f_id = {$this->user['user_id']} or t_id = {$this->user['user_id']}) and state = 1";$items = $query->find(); foreach($items as $key => $item){?>
				
				<?php if($item['f_id'] == $this->user['user_id']){?>
					<?php $f_uid = $item['t_id']?>
				<?php }else{?>
					<?php $f_uid = $item['f_id']?>	
				<?php }?>	
				
			<dd title="你好" from_id = "<?php echo isset($f_uid)?$f_uid:"";?>">
				<span class="user_avatar">
						 <?php $query = new IQuery("user");$query->where = "id = $f_uid";$items = $query->find(); foreach($items as $key => $first){?> 
						 	<?php if($first['head_ico'] == ""){?>
						 		<img alt="" src="<?php echo IUrl::creatUrl("upload/car.jpg");?>"> 
								<?php $ava_img='upload/car.jpg'?>
						 		<?php }else{?>
						 		<img alt="" src="<?php echo IUrl::creatUrl("".$first['head_ico']."");?>"> 
								<?php $ava_img=$first['head_ico']?>
						 	<?php }?>
							<!-- <?php $ava_img1=$first['head_ico1']?> -->
						<?php }?>
					<i class="offline" f_id="<?php echo isset($f_uid)?$f_uid:"";?>"></i>
				</span>
				
				<?php if($item['f_id'] == $this->user['user_id']){?>
					<h5><?php echo isset($item['t_name'])?$item['t_name']:"";?></h5><!-- <?php echo isset($item['t_id'])?$item['t_id']:"";?> -->
					<a href="javascript:"  onclick="talk(<?php echo isset($this->user['user_id'])?$this->user['user_id']:"";?>,<?php echo isset($item['t_id'])?$item['t_id']:"";?>,<?php echo isset($item['id'])?$item['id']:"";?>,'<?php echo IUrl::creatUrl("".$ava_img."");?>','<?php echo isset($item['t_name'])?$item['t_name']:"";?>')"></a>
					<?php }else{?>
					<h5><?php echo isset($item['f_name'])?$item['f_name']:"";?></h5>
					<a href="javascript:"  onclick="talk(<?php echo isset($this->user['user_id'])?$this->user['user_id']:"";?>,<?php echo isset($item['f_id'])?$item['f_id']:"";?>,<?php echo isset($item['id'])?$item['id']:"";?>,'<?php echo IUrl::creatUrl("".$ava_img."");?>','<?php echo isset($item['f_name'])?$item['f_name']:"";?>') "></a>
				<?php }?> 
				
			</dd>
			<?php }?>
		</dl>
		
		<dl class="chat_user_recent">
			<dt>
				最近联系人
				<span class="show"></span>
			</dt>
			
			<?php $l_uid?>
			<!-- 查找临时的人 -->
	<?php $query = new IQuery("friends");$query->where = "(f_id = {$this->user['user_id']} or t_id = {$this->user['user_id']}) and state = 0";$items = $query->find(); foreach($items as $key => $item){?>
			
			<?php if($item['f_id'] == $this->user['user_id']){?>
				<?php $l_uid = $item['t_id']?>
			<?php }else{?>
				<?php $l_uid = $item['f_id']?>
			<?php }?>
				
			<dd title="你好   <?php echo isset($l_uid)?$l_uid:"";?>" from_id = "<?php echo isset($l_uid)?$l_uid:"";?>">
				<span class="user_avatar">
					
						<?php $query = new IQuery("user");$query->where = "id = $l_uid";$items = $query->find(); foreach($items as $key => $first){?> 
						 	<?php if($first['head_ico'] == ""){?>
						 		<img alt="" src="<?php echo IUrl::creatUrl("upload/car.jpg");?>"> 
								<?php $ava_img='upload/car.jpg'?>
						 		<?php }else{?>
						 		<img alt="" src="<?php echo IUrl::creatUrl("".$first['head_ico']."");?>"> 
								<?php $ava_img=$first['head_ico']?>
						 	<?php }?>
							<!-- <?php $ava_img1=$first['head_ico1']?> -->
						<?php }?>
						<i class="offline" f_id="<?php echo isset($l_uid)?$l_uid:"";?>"></i>
				</span>
					<?php if($item['f_id'] == $this->user['user_id']){?>
					<h5><?php echo isset($item['t_name'])?$item['t_name']:"";?></h5>
					<a href="javascript:"  onclick="talk(<?php echo isset($this->user['user_id'])?$this->user['user_id']:"";?>,<?php echo isset($item['t_id'])?$item['t_id']:"";?>,<?php echo isset($item['id'])?$item['id']:"";?>,'<?php echo isset($ava_img)?$ava_img:"";?>','<?php echo isset($item['t_name'])?$item['t_name']:"";?>')"></a>
					<?php }else{?>
					<h5><?php echo isset($item['f_name'])?$item['f_name']:"";?></h5>
					<a href="javascript:"  onclick="talk(<?php echo isset($this->user['user_id'])?$this->user['user_id']:"";?>,<?php echo isset($item['f_id'])?$item['f_id']:"";?>,<?php echo isset($item['id'])?$item['id']:"";?>,'<?php echo isset($ava_img)?$ava_img:"";?>','<?php echo isset($item['f_name'])?$item['f_name']:"";?>')"></a>
				<?php }?>
			</dd>
			<?php }?>
		</dl>
	</div>
	
</div>
<?php }?>
<!-- 聊天窗口我好友列表 e -->


<?php if($this->user){?>
<!-- 聊天窗口内容接收与发送 s msg-dialog 1-->
<?php $i=1?>	
<?php $to_Id?>
<?php $to_uname?>
<?php $ava?>
<?php $query = new IQuery("friends");$query->where = "f_id = {$this->user['user_id']} or t_id = {$this->user['user_id']}";$items = $query->find(); foreach($items as $key => $item){?>
		<?php if($item['f_id'] == $this->user['user_id']){?>
			<?php $to_Id = $item['t_id']?>
			<?php }else{?>
			<?php $to_Id = $item['f_id']?>
		<?php }?>
		
		<?php $query = new IQuery("user");$query->where = "id = $to_Id";$items = $query->find(); foreach($items as $key => $first){?>
			<?php $to_uname = $first['username']?>
			<?php if($first['head_ico'] == ""){?>
				
				<?php $ava='upload/car.jpg'?>
			<?php }else{?>
				<?php $ava = $first['head_ico']?>
			<?php }?>
		<?php }?>
		
<div class="msg-dialog isshow<?php echo isset($item['id'])?$item['id']:"";?>" id="dialog" draggable="false" from_id="">
	<div id="dialog_header" class="d_h" value="<?php echo isset($i)?$i:"";?>" draggable="true">
	<?php if($ava == ""){?>
		<img class="to_user_img" alt="" src="<?php echo IUrl::creatUrl("upload/car.jpg");?>"> 
		<?php }else{?>
		<img class="to_user_img" alt="" src="<?php echo IUrl::creatUrl("".$ava."");?>"> 
	<?php }?>
		<span><?php echo isset($to_uname)?$to_uname:"";?></span>
		<div class="close_big">
			<span>×</span>
		</div>
	</div>
	
	
	<input class="to" type="hidden" value="<?php echo isset($to_Name)?$to_Name:"";?>"/>
	
	<!-- 聊天记录 -->
	<div class="dialog-body">
		<!-- 用户的聊天内容 -->
		<div class="msg_list">
			<div class="chat_con"> 
				<!-- 发送者信息 -->
			<!--	<div class="to_user">
					<span class="user-avatar">
						<img alt="" src="<?php echo IUrl::creatUrl("")."".$user_ico."";?>">
					</span>-->
					<!-- 发送给用户的内容 s-->
					<!--<dl>
						<dt>2017-05-16 10:49:19</dt>
						<dd>kdf;msdlfmmsdlfmsdklfmsdklmsdlfmmsdlfmsdklfmsdklgsdklfmsdklggsdklfmsdklg</dd>
						<dd class="arrow"></dd>
					</dl>
				</div>-->
				<!-- 发送给用户的内容 e-->
				
				<!-- 接收用户的内容  s-->
				<!-- <div class="from_user">
					<span class="user-avatar">
						<img alt="" src="<?php echo $this->getWebSkinPath()."image/logo.png";?>">
					</span> -->
					<!-- 发送内容 -->
					<!--<dl>
						<dt>2017-05-16 10:49:19</dt>
						<dd>kdf;msdlfmmsklmsdlfmmsklfklfmsdklgmsdlfmmsklfklfmsdklgfklfmsdklg</dd>
						<dd class="arrow"></dd>
					</dl>
				</div> -->
				<!-- 接收用户的内容 e-->
				
			</div>
		</div>
		<div class="msg-input-box">
			<!-- 表情栏 s-->
			
			<!-- 表情 -->
			<div class="s_img">
				<?php for($num = 1 ; $num<=77 ; $num = $num+1){?>
					<div  class="event_one">
						<img alt="<?php echo isset($num)?$num:"";?>.gif" src="<?php echo IUrl::creatUrl("upload/talkimg/".$num."");?>.gif">
					</div>
				<?php }?>
			</div>
			
			<div class="msg-input-title">
				<span class="chat_show">
					<img alt="" src="<?php echo $this->getWebSkinPath()."image/show.png";?>">
				</span>
				
				<span class="chat_phpne">
					
					<img alt="" src="<?php echo $this->getWebSkinPath()."image/photo.png";?>" class="photo_upload">
						<input type="file" id="upp" name="photo" style="display: none" onchange="select_photo()" />
					</img>
				</span>
				
				<span class="message">
					消息记录
					<img alt="" src="<?php echo $this->getWebSkinPath()."image/down.png";?>">
				</span>
			</div>
			<!-- 表情栏 e-->
			
			<!-- 内容输入框 s-->
			<textarea class="send_message"></textarea>
			<!-- 内容输入框 e-->
			<span class="ad"><a href="#">广告词可以在这里加链接</a></span>
			<span class="send_btn" ><a href="javascript:">发送消息</a></span>
						
		</div>
	</div>
	
	<div class="dialog_chat_right" >
		<!-- 消息记录 -->
	</div>
	
</div>
<?php $i=$i+1?>	
<?php }?>
<?php }?>
<!-- 聊天窗口内容接收与发送 s msg-dialog-->


<!--

模版使用字体图标为优化过的 awesome 3.0 图标字体库

使用帮助见:http://www.bootcss.com/p/font-awesome/

 -->
<div class="header_top">
	<div class="web">
		<div class="welcome">
			欢迎您来到 <?php echo $this->_siteConfig->name;?>！
			<?php if($this->user){?>
				<a href="<?php echo IUrl::creatUrl("/ucenter/index");?>">个人中心</a>
				<a href="<?php echo IUrl::creatUrl("/simple/logout");?>">退出</a>
			<?php }else{?>
				<a href="<?php echo IUrl::creatUrl("/simple/login");?>">登录</a>
				<a class="reg" href="<?php echo IUrl::creatUrl("/simple/reg");?>">免费注册</a>
			<?php }?>
		</div>
		<div class="header_cart" name="mycart">
			<a href="<?php echo IUrl::creatUrl("/simple/cart");?>" class="go_cart">
				<i class="icon-shopping-cart"></i>
				购物车（<em class="count" name="mycart_count"]>0</em>）
			</a>
			<div class="cart_simple" id="div_mycart"></div>
		</div>
		<!--购物车模板 开始-->
		<script type='text/html' id='cartTemplete'>
		<div class='cart_panel'>
			<ul class='cart_list'>
				<%for(var item in goodsData){%>
				<%var data = goodsData[item]%>
				<li id="site_cart_dd_<%=item%>">
					<em>共<%=data['count']%>件</em>
					<a target="_blank" href="<?php echo IUrl::creatUrl("/site/products/id/<%=data['goods_id']%>");?>">
						<img src="<?php echo IUrl::creatUrl("")."<%=data['img']%>";?>">
						<h5><%=data['name']%></h5>
					</a>
					<span>￥ <%=data['sell_price']%></span>
					<del onclick="removeCart('<%=data['id']%>','<%=data['type']%>');$('#site_cart_dd_<%=item%>').hide('slow');">删除</del>
				</li>
				<%}%>
				<%if(goodsCount){%>
				<div class="cart_total">
					<p>共<span name="mycart_count"><%=goodsCount%></span>件商品</p>
					<p>商品总额：<em name="mycart_sum">￥<%=goodsSum%></em></p>
					<a href="<?php echo IUrl::creatUrl("simple/cart");?>">去购物车结算</a>
				</div>
				<%}else{%>
				<div class='cart_no'>购物车空空如也~</div>
				<%}%>
			</ul>
		</div>
		</script>
		<ul class="top_tool">
			<li><a href="<?php echo IUrl::creatUrl("ucenter/index");?>">个人中心</a></li>
			<?php if($this->user){?>
			<li><a href="<?php echo IUrl::creatUrl("/simple/seller");?>">申请开店</a></li>
			<?php }?>
			<li><a href="<?php echo IUrl::creatUrl("/seller/index");?>">商家管理</a></li>
			<li><a href="<?php echo IUrl::creatUrl("/site/help_list");?>">使用帮助</a></li>
		</ul>
	</div>
</div>

<?php
	
	//获取板块信息
	//echo "session is <br/>";
	//$type   = ISession::get('plate_type');
	//$type = $plate_type[0]['plate_id'];
	
?>



<header class="header web">
	<nav class="header_nav">
		<div class="goods_nav">
			<h1 class="logo">
				<!-- 这里的LOGO图片会自动靠左居中.因此只需要制作一个透明的LOGO图片即可 LOGO最大尺寸 200*90 -->
				<a href="<?php echo IUrl::creatUrl("");?>">
					<img src="<?php if($this->_siteConfig->logo){?><?php echo IUrl::creatUrl("")."".$this->_siteConfig->logo."";?><?php }else{?><?php echo $this->getWebSkinPath()."image/logo.png";?><?php }?>">
				</a>
			</h1>
			<ul class="cat_list none">
				<?php foreach(Api::run('getCategoryListTop') as $key => $first){?>
				
							
				<li>
					<h3><a href="<?php echo IUrl::creatUrl("/site/pro_list/cat/".$first['id']."");?>"><?php echo isset($first['name'])?$first['name']:"";?></a></h3>
					<div class="cat_more">
						<ul>
							<?php foreach(Api::run('getCategoryExtendList',array('#categroy_id#',$first['id']),24) as $key => $item){?>
							<li>
								<a href="<?php echo IUrl::creatUrl("/site/products/id/".$item['id']."");?>" target="_blank" title="<?php echo isset($item['name'])?$item['name']:"";?>">
									<img class="img-lazyload" src="<?php echo IUrl::creatUrl("/pic/thumb/img/".$item['img']."/w/40/h/40");?>" alt="<?php echo isset($item['name'])?$item['name']:"";?>">
									<strong><?php echo isset($item['name'])?$item['name']:"";?></strong>
									<em>选购</em>
								</a>
							</li>
							<?php }?>
						</ul>
					</div>
				</li>
				
				<?php }?>
			</ul>
		</div>
		<ul class="site_nav">
			<li><a href="<?php echo IUrl::creatUrl("/site/index");?>">首页</a></li>
			<?php foreach(Api::run('getGuideList') as $key => $item){?>
			<li><a href="<?php echo IUrl::creatUrl("".$item['link']."");?>"><?php echo isset($item['name'])?$item['name']:"";?></a></li>
			<?php }?>
		</ul>
	</nav>
	
	<div class="tran_seach">切换</div>
	<div class="header_search goods">
		
		<form method='get' action='<?php echo IUrl::creatUrl("/");?>'>
			<input type='hidden' name='controller' value='site'>
			<input type='hidden' name='action' value='search_list'>
			<div class="search_box">
				<input class="input_keywords" type="text" name='word' autocomplete="off" placeholder="输入关键词">
				<label class="input_submits">
					<input type="submit" value="">
					<i class="icon-search"></i>
				</label>
			</div>
		</form>
		<div class="hot_words">
			<?php foreach(Api::run('getKeywordList',2) as $key => $item){?>
			<?php $tmpWord = urlencode($item['word']);?>
			<a href="<?php echo IUrl::creatUrl("/site/search_list/word/".$tmpWord."");?>"><?php echo isset($item['word'])?$item['word']:"";?></a>
			<?php }?>
		</div>
	</div>
	
	<!-- 店铺搜索 -->
	<div class="header_search store">
		
		<form method='get' action='<?php echo IUrl::creatUrl("/site/store_seach");?>'>
			<input type='hidden' name='controller' value='site'>
			<input type='hidden' name='action' value='search_list'>
			<div class="search_box">
				<input class="input_keywords" type="text" name='word' autocomplete="off" placeholder="店铺搜索">
				<label class="input_submits">
					<input type="submit" value="">
					<i class="icon-search"></i>
				</label>
			</div>
		</form>
		<div class="hot_words">
			<!-- 
			<?php foreach(Api::run('getKeywordList',2) as $key => $item){?>
			<?php $tmpWord = urlencode($item['word']);?>
			<a href="<?php echo IUrl::creatUrl("/site/search_list/word/".$tmpWord."");?>"><?php echo isset($item['word'])?$item['word']:"";?></a>
			<?php }?> -->
			
			
			<a href="<?php echo IUrl::creatUrl("/site/store_seach?controller=site&action=search_list&word=米喀");?>">米喀</a>
			<a href="<?php echo IUrl::creatUrl("/site/store_seach?controller=site&action=search_list&word=香车");?>">香车</a>
		</div>
	</div>

</header>

<script type="text/javascript">

	$(".tran_seach").toggle(function(){
		$(".goods").hide();
		$(".store").show();
	},function(){
		$(".store").hide();
		$(".goods").show();
	});

			
		
</script>

<!--主要模板内容 开始-->
<script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/jqueryZoom/jquery.imagezoom.min.js"></script><link rel="stylesheet" type="text/css" href="/git/micarshop/runtime/_systemjs/jqueryZoom/imagezoom.css" />
<script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/jquerySlider/jquery.bxslider.min.js"></script><link rel="stylesheet" type="text/css" href="/git/micarshop/runtime/_systemjs/jquerySlider/jquery.bxslider.css" />

<?php
	
	$siteConfigObj = new Config("site_config");
	$site_config   = $siteConfigObj->getInfo();
	//print_r($site_config);
	
	$sum = 0;
	$userPoint = 0;
?>

<!-- <?php echo $site_config['jifencon'];?> -->

<script type="text/javascript" src="<?php echo $this->getWebViewPath()."javascript/products.js";?>"></script>
<?php $breadGuide = goods_class::catRecursion($category);?>
<div class="bigweb">
	<section class="breadcrumb">
		<span>您当前的位置：</span> <a href="<?php echo IUrl::creatUrl("");?>">首页</a> »
		<?php foreach($breadGuide as $key => $item){?>
		<a href='<?php echo IUrl::creatUrl("/site/pro_list/cat/".$item['id']."");?>'><?php echo isset($item['name'])?$item['name']:"";?></a> »
		<?php }?>
		<?php echo isset($name)?$name:"";?>
	</section>
	<input type='hidden' id='xiaoshou_type' value='<?php echo isset($xiaoshou_type)?$xiaoshou_type:"";?>' />
	<input type='hidden' id='seller_name' value='<?php echo isset($seller_name)?$seller_name:"";?>' />
	<section class="goods_base">
		<!--图片放大镜-->
		<section class="goods_zoom">
			<div class="pic_show" style="width:435px;height:435px;position:relative;z-index:5;padding-bottom:5px;">
				<img id="picShow" rel="" src="" />
			</div>

			<ul id="goodsPhotoList" class="pic_thumb">
				<?php foreach($photo as $key => $item){?>
				<li>
					<a href="javascript:void(0);" thumbimg="<?php echo IUrl::creatUrl("/pic/thumb/img/".$item['img']."/w/435/h/435");?>" sourceimg="<?php echo IUrl::creatUrl("")."".$item['img']."";?>">
						<img src='<?php echo IUrl::creatUrl("/pic/thumb/img/".$item['img']."/w/60/h/60");?>' width="60px" height="60px" />
					</a>
				</li>
				<?php }?>
			</ul>
		</section>
		<section class="goods_info">
			<h1 class="goods_info_title"><?php echo isset($name)?$name:"";?></h1>
			<div class="goods_info_num">商品编号：<span id="data_goodsNo"><?php echo $goods_no?$goods_no:$id;?></span></div>
			<!--基本信息区域-->
			<ul class="goods_ul">
				<li>
					<?php if(isset($brand)){?>品牌：<?php echo isset($brand)?$brand:"";?><?php }?>
				</li>
				<!--抢购活动,引入 "_products_time"模板-->
				<?php if($promo == 'time' && isset($time)){?>
				<?php require(ITag::createRuntime("_products_time"));?>
				<?php }?>
				<!--团购活动,引入 "_products_groupon"模板-->
				<?php if($promo == 'groupon' && isset($groupon)){?>
				<?php require(ITag::createRuntime("_products_groupon"));?>
				<?php }?>
				<!--普通正常-->
				<?php if($promo == ''){?>
					<?php if($group_price){?>
					
					<li>会员价：<em class="price">￥<span id="data_groupPrice"><?php echo isset($group_price)?$group_price:"";?></span></em></li>
					<li>原售价：￥<del id="data_sellPrice"><?php echo isset($sell_price)?$sell_price:"";?></del></li>
					<?php }else{?>
					   <?php if($isjifen == 1){?>
							<li>销售价：<em class="price">￥<span id="data_sellPrice"><?php echo isset($sell_price)?$sell_price:"";?></span></em></li>
							<?php 
								$sum = $sell_price * $duihuanpoint * 0.01 * $site_config['jifencon'];
								
							?>
							<li>最高可兑换积分：<span><?php echo isset($sum)?$sum:"";?></span></li>
						<?php }else{?>
							<li>销售价：<em class="price">￥<span id="data_sellPrice"><?php echo isset($sell_price)?$sell_price:"";?></span></em></li>
					   <?php }?>
					<?php }?>
				<?php }?>

				<li>市场价：￥<del id="data_marketPrice"><?php echo isset($market_price)?$market_price:"";?></del></li>
				
				<li>
					库存：现货 <span id="data_storeNums"><?php echo isset($store_nums)?$store_nums:"";?> </span>
					<span class="favorite" onclick="favorite_add_ajax(<?php echo isset($id)?$id:"";?>,this);">
						<i class="icon-heart"></i>
						收藏此商品
					</span>
				</li>

				<li>
					<div class="star_box">
						<strong class="item">顾客评分：</strong>
						<span class="star star_<?php echo Common::gradeWidth($grade,$comments);?>"></span>
						<u>(已有<?php echo isset($comments)?$comments:"";?>人评价)</u>
					</div>
				</li>

				<?php if($point > 0){?>
				<li>送积分：单件送<?php echo isset($point)?$point:"";?>分</li>
				<?php }?>
				
				<?php if($good_type == 1){?>
				<li>
					至
					<a class="sel_area blue" href="javascript:;" name="localArea">当前地区</a>：
					<span id="deliveInfo"></span>
					<div class="area_box">
						<ul>
							<li><a data-code="1" href="#J_PostageTableCont"><strong>全部</strong></a></li>
							<?php foreach(Api::run('getAreasListTop') as $key => $item){?>
							<li><a href="javascript:void(0);" name="areaSelectButton" value="<?php echo isset($item['area_id'])?$item['area_id']:"";?>"><?php echo isset($item['area_name'])?$item['area_name']:"";?></a></li>
							<?php }?>
						</ul>
					</div>
				</li>
				<?php }else{?>
				<li>
					<dl>
			         <dt>提货方式：</dt>
			         <a><dd>电子兑换券</dd></a>
			        </dl>
				</li>
				<?php }?>
				<!--商家信息 开始-->
				<?php if(isset($seller)){?>
				<li>商家：<a class="orange" href="<?php echo IUrl::creatUrl("/site/home/id/".$seller_id."");?>"><?php echo isset($seller['store_name'])?$seller['store_name']:"";?></a></li>
				<li>联系电话：<?php echo isset($seller['mobile'])?$seller['mobile']:"";?></li>
				<li>所在地：<?php echo join(' ',area::name($seller['province'],$seller['city'],$seller['area']));?></li>
				<li><?php plugin::trigger("onServiceButton",$seller['id'])?></li>
				<?php }?>
				<!--商家信息 结束-->
			</ul>
			<!--购买区域-->
			
			
			
			<div class="good_info_buy">
			<?php if($store_nums <= 0){?>
				该商品已售完，不能购买，您可以看看其它商品！(<a href="<?php echo IUrl::creatUrl("/simple/arrival/goods_id/".$id."");?>" class="orange">到货通知</a>)
			<?php }else{?>
				<?php if($spec_array){?>
				<!--商品规格选择 开始-->
				<?php foreach(JSON::decode($spec_array) as $key => $item){?>
				<dl>
					<dt><?php echo isset($item['name'])?$item['name']:"";?>：</dt>
					<dd>
						<div class="item">
						<?php foreach($item['value'] as $specValueKey => $spec_value){?>
						<?php list($item['tip'],$item['value'])=each($spec_value);?>
						<?php if($item['type'] == 1){?>
						<!--文字规格 -->
						<span  specId="<?php echo isset($item['id'])?$item['id']:"";?>" id="<?php echo isset($item['id'])?$item['id']:"";?><?php echo isset($specValueKey)?$specValueKey:"";?>" title="<?php echo htmlspecialchars($item['tip']);?>"><?php echo isset($item['value'])?$item['value']:"";?></span>

						<?php }else{?>
						<!--图片规格 -->
						<span  specId="<?php echo isset($item['id'])?$item['id']:"";?>" id="<?php echo isset($item['id'])?$item['id']:"";?><?php echo isset($specValueKey)?$specValueKey:"";?>" title="<?php echo htmlspecialchars($item['tip']);?>">
							<img src="<?php echo IUrl::creatUrl("")."".$item['value']."";?>">
						</span>
						<?php }?>
						<script>$('#<?php echo isset($item['id'])?$item['id']:"";?><?php echo isset($specValueKey)?$specValueKey:"";?>').data('specData',<?php echo JSON::encode($item);?>);</script>
						<?php }?>
						</div>
					</dd>
				</dl>
				<?php }?>
				<!--商品规格选择 结束-->
				<?php }?>
				
					<?php if($isjifen == 1){?>
					<?php 
						$userid = $this->user['user_id'];
						$userPoint=0;
					?>
					<?php if($userid != ""){?>
						<?php $query = new IQuery("member");$query->where = "user_id = $userid";$items = $query->find(); foreach($items as $key => $item){?><?php }?>
						<?php $userPoint = $item['point'] ?>
					<?php }?>
						<dl>
							<dt>填写积分：</dt>
							<dd>
								<div class="goods_resize">
									<span class="reduce2" id="buyReduceButton2">─</span>
									<input class="input onlost" type="text" id="buyNums" value="0" maxlength="10" onBlur="inputPointLost()"  />
									<span class="add2" id="buyAddButton2">+</span>
								</div>
							</dd>
						</dl>
						<dl><dt>当前积分：</dt><dd class="userpoint"><?php echo isset($userPoint)?$userPoint:"";?></dd></dl>
					<?php }else{?>
					<dl>
						<dt>购买数量：</dt>
						<dd>
							<div class="goods_resize">
								<span class="reduce" id="buyReduceButton">─</span>
								<input class="input" type="text" id="buyNums" value="1" maxlength="5" />
								<span class="add" id="buyAddButton">+</span>
							</div>
						</dd>
						<dt>购买数量：</dt>
					</dl>
					<?php }?>
				
				<?php }?>
				<a href="javascript:" onclick="makeFriend()">联系客服</a>
				
				<?php if($isjifen == 1){?>
				<div class="btn_submit_buy" id="buyNowButton2" onclick="jifencommit()">
					<i class="icon-shopping-cart"></i>
					<span>立即购买</span>
				</div>
				<?php }else{?>
				<div class="btn_submit_buy" id="buyNowButton">
					<i class="icon-shopping-cart"></i>
					<span>立即购买</span>
				</div>
				
				<div class="btn_add_cart" id="joinCarButton">
					<i class="icon-shopping-cart"></i>
					<span>加入购物车</span>
				</div>
			<?php }?>
			</div>
		</section>
	</section>

	<section class="web">
		<section class="main">
			<div class="goods_tab" name="showButton">
				<label class="current">商品详情</label>
				<label>顾客评价(<?php echo isset($comments)?$comments:"";?>)</label>
				<label>购买记录(<?php echo isset($buy_num)?$buy_num:"";?>)</label>
				<label>购买前咨询(<?php echo isset($refer)?$refer:"";?>)</label>
				<label>网友讨论圈(<?php echo isset($discussion)?$discussion:"";?>)</label>
			</div>
			<div class="goods_con" name="showBox">
				<!-- 商品详情 start -->
				<div>
					<ul class="goods_infos">
						<li>商品名称：<?php echo isset($name)?$name:"";?></li>

						<?php if(isset($brand) && $brand){?>
						<li>品牌：<?php echo isset($brand)?$brand:"";?></li>
						<?php }?>

						<?php if(isset($weight) && $weight){?>
						<li>商品毛重：<label id="data_weight"><?php echo isset($weight)?$weight:"";?></label></li>
						<?php }?>

						<?php if(isset($unit) && $unit){?>
						<li>单位：<?php echo isset($unit)?$unit:"";?></li>
						<?php }?>

						<?php if(isset($up_time) && $up_time){?>
						<li>上架时间：<?php echo isset($up_time)?$up_time:"";?></li>
						<?php }?>

						<?php if(($attribute)){?>
						<?php foreach($attribute as $key => $item){?>
						<li><?php echo isset($item['name'])?$item['name']:"";?>：<?php echo isset($item['attribute_value'])?$item['attribute_value']:"";?></li>
						<?php }?>
						<?php }?>
					</ul>
					<?php if(isset($content) && $content){?>
					<article class="article_content">
						<h3>产品描述：</h3>
						<?php echo isset($content)?$content:"";?>
					</article>
					<?php }?>
				</div>
				<!-- 商品详情 end -->

				<!-- 顾客评论 start -->
				<div class="none comment_list">
					<div id='commentBox'></div>
					<!--评论JS模板-->
					<script type='text/html' id='commentRowTemplate'>
					<div class="comment_item">
						<div class="user">
							<img src="<?php echo IUrl::creatUrl("")."<%=head_ico%>";?>" width="70px" height="70px" onerror="this.src='<?php echo $this->getWebSkinPath()."image/user_ico.gif";?>'" />
							<span><%=username%></span>
						</div>
						<div class="desc">
							<time><%=comment_time%></time>
							<div class="star_box">
								<strong class="item">评分：</strong>
								<span class="star star_<%=point%>"></span>
							</div>
							<p class="contents"><strong>评价：</strong><span><%=contents%></span></p>
							<%if(recontents){%>
							<p class="recontents"><strong>回复：</strong><span><%=recontents%></span></p>
							<%}%>
						</div>
					</div>
					</script>
				</div>
				<!-- 顾客评论 end -->

				<!-- 购买记录 start -->
				<div class="none history_list">
					<table>
						<thead>
							<tr>
								<th>购买人</th>
								<th>出价</th>
								<th>数量</th>
								<th>购买时间</th>
								<th>状态</th>
							</tr>
						</thead>
						<tbody class="dashed" id="historyBox"></tbody>
					</table>
					<!--购买历史js模板-->
					<script type='text/html' id='historyRowTemplate'>
					<tr>
						<td><strong><%=username?username:'游客'%></strong></td>
						<td><em><%=goods_price%></em></td>
						<td><u><%=goods_nums%></u></td>
						<td><time><%=completion_time%></time></td>
						<td><span>成交</span></td>
					</tr>
					</script>
				</div>
				<!-- 购买记录 end -->

				<!-- 购买前咨询 start -->
				<div class="none ask_list ">
					<a class="ask_btn" href="<?php echo IUrl::creatUrl("/site/consult/id/".$id."");?>">我要咨询</a>
					<div id='referBox'></div>
					<!--购买咨询JS模板-->
					<script type='text/html' id='referRowTemplate'>
					<div class="ask_item">
						<div class="user">
							<img src="<?php echo IUrl::creatUrl("")."<%=head_ico%>";?>" width="70px" height="70px" onerror="this.src='<?php echo $this->getWebSkinPath()."image/user_ico.gif";?>'" />
							<span><%=username%></span>
						</div>
						<div class="desc">
							<header>
								<i class="icon-comment-alt"></i>
								<strong>咨询内容：</strong>
								<time><%=time%></time>
							</header>
							<section><%=question%></section>
							<%if(answer){%>
							<div class="answer">
								<header>
									<i class="icon-comments-alt"></i>
									<strong>商家回复：</strong>
									<time><%=reply_time%></time>
								</header>
								<section><%=answer%></section>
							</div>
							<%}%>
						</div>
					</div>
					</script>
				</div>
				<!-- 购买前咨询 end -->

				<!-- 网友讨论圈 start -->
				<div class="none discussion_list">
					<a class="ask_btn" name="discussButton">发表话题</a>
					<div id='discussBox'></div>
					<!--讨论JS模板-->
					<script type='text/html' id='discussRowTemplate'>
						<div class="discussion_item">
							<strong><%=username%></strong>
							<time><%=time%></time>
							<p><%=contents%></p>
						</div>
					</script>
					<section class="discuss_form none" id="discussTable">
						<dl>
							<dt>讨论内容：</dt>
							<dd><textarea class="input_textarea" id="discussContent" pattern="required" alt="请填写内容"></textarea></dd>
						</dl>
						<dl>
							<dt>验证码：</dt>
							<dd>
								<input type='text' class='input_text w100' name='captcha' pattern='^\w{5}$' alt='填写下面图片所示的字符' />
								<img src='<?php echo IUrl::creatUrl("/site/getCaptcha");?>' id='captchaImg' onclick="changeCaptcha()" />
							</dd>
						</dl>
						<dl>
							<dt></dt>
							<dd><input class="input_submit" type="submit" name="sendDiscussButton" value="发表" /></dd>
						</dl>
					</section>
				</div>
				<!-- 网友讨论圈 end -->
			</div>
		</section>
		<aside class="bar">
			<nav class="bar_box">
				<h3 class="bar_box_head">促销活动</h3>
				<ul class="bar_nav">
					<?php foreach(Api::run('getProrule',$seller_id) as $key => $item){?>
					<li><?php echo isset($item['info'])?$item['info']:"";?></li>
					<?php }?>
				</ul>
			</nav>
			<div class="bar_box">
				<h3 class="bar_box_head">热卖排行</h3>
				<ul class="bar_goods_big">
					<?php foreach(Api::run('getCommendHot') as $key => $item){?>
					<li>
						<a href="<?php echo IUrl::creatUrl("/site/products/id/".$item['id']."");?>">
							<img src="<?php echo IUrl::creatUrl("/pic/thumb/img/".$item['img']."/w/205/h/205");?>" alt="<?php echo isset($item['name'])?$item['name']:"";?>">
							<span><?php echo isset($item['name'])?$item['name']:"";?></span>
							<em>￥<?php echo isset($item['sell_price'])?$item['sell_price']:"";?></em>
						</a>
					</li>
					<?php }?>
				</ul>
			</div>
		</aside>
	</section>
</div>
<script>
$(function(){
	
	//初始化商品详情对象
	var productInstance = new productClass("<?php echo isset($id)?$id:"";?>","<?php echo isset($this->user['user_id'])?$this->user['user_id']:"";?>","<?php echo isset($promo)?$promo:"";?>","<?php echo isset($active_id)?$active_id:"";?>","<?php echo isset($isjifen)?$isjifen:"";?>","$seller_id");

	//初始化商品轮换图
	$('#goodsPhotoList').bxSlider({
		infiniteLoop:false,
		hideControlOnEnd:true,
		controls:true,
		pager:false,
		minSlides: 5,
		maxSlides: 5,
		slideWidth: 72,
		slideMargin: 15,
		onSliderLoad:function(currentIndex){
			//默认初始化显示第一张
			$('[thumbimg]:eq('+currentIndex+')').trigger('click');
			//放大镜
			$("#picShow").imagezoom();
		}
	});
	

	//城市地域选择按钮事件
	$('.sel_area').hover(
		function(){
			$('.area_box').show();
		},function(){
			$('.area_box').hide();
		}
	);

	$('.area_box').hover(
		function(){
			$('.area_box').show();
		},function(){
			$('.area_box').hide();
		}
	);

	//按钮绑定
	$('[name="showButton"]>label').click(function(){
		$(this).siblings().removeClass('current');
		$(this).addClass('current');

		$('[name="showBox"]>div').hide();
		$('[name="showBox"]>div:eq('+$(this).index()+')').show();

		switch($(this).index())
		{
			case 1:
			{
				productInstance.comment_ajax();
			}
			break;

			case 2:
			{
				productInstance.history_ajax();
			}
			break;

			case 3:
			{
				productInstance.refer_ajax();
			}
			break;

			case 4:
			{
				productInstance.discuss_ajax();
			}
			break;
		}
	});
	
	/*
	* 	积分商品计算
	*/
	var minpoint = <?php echo isset($site_config['jifencon'])?$site_config['jifencon']:"";?>;
	var maxpoint = <?php echo isset($sum)?$sum:"";?>;
	var userpoint = <?php echo isset($userPoint)?$userPoint:"";?>;
	var sell_price = <?php echo isset($sell_price)?$sell_price:"";?>;
	
	//减
	$("#buyReduceButton2").click(function(){
		
		//var u_point = $(".userpoint").html();
		
		var nowpoint = $("#buyNums").val();
		var s = parseInt(nowpoint) - parseInt(minpoint);
		if(s < 0){
			var u_point = $(".userpoint").html();
			$(".userpoint").html(parseInt(u_point) + parseInt(nowpoint));
			nowpoint = 0;
			
		}else{
			nowpoint = parseInt(nowpoint) - parseInt(minpoint) ; 
			var u_point = $(".userpoint").html();
			$(".userpoint").html(parseInt(u_point) + minpoint);
		}
		$("#buyNums").val(nowpoint);
		
		//计算兑换积分后的价格
		var after_price =  parseInt(sell_price) - (parseInt(nowpoint) / parseInt(minpoint));
		
		if(nowpoint == 0){
			$("#data_sellPrice").html(after_price);
		}else{
			$("#data_sellPrice").html(after_price+"+"+nowpoint+"积分");
		}
		
		console.log("结算后   "+after_price);
		
	}); 
	
	//加
	$("#buyAddButton2").click(function(){
		var nowpoint = $("#buyNums").val();
		var s = parseInt(nowpoint) + parseInt(minpoint);
		if(s > maxpoint){
			
			var u_point = $(".userpoint").html();
			var add = maxpoint - nowpoint;
			$(".userpoint").html(u_point - add);
			nowpoint = maxpoint;
			
		}else if(s > userpoint){
			var u_point = $(".userpoint").html(0);
			nowpoint = userpoint ; 
		}else{
			var u_point = $(".userpoint").html();
			$(".userpoint").html(parseInt(u_point) - minpoint);
			nowpoint = s;
		}
		
		$("#buyNums").val(nowpoint);
		
				
		//计算兑换积分后的价格
		var after_price =  parseInt(sell_price) - (parseInt(nowpoint) / parseInt(minpoint));
		console.log("结算后   "+after_price);
		
		if(nowpoint == 0){
			$("#data_sellPrice").html(after_price);
		}else{
			$("#data_sellPrice").html(after_price+"+"+nowpoint+"积分");
		}
		
	}); 
	
	//输入积分框失去焦点响应
	
	
	
});

	var minpoint = <?php echo isset($site_config['jifencon'])?$site_config['jifencon']:"";?>;
	var maxpoint = <?php echo isset($sum)?$sum:"";?>;//最高积分
	var userpoint = <?php echo isset($userPoint)?$userPoint:"";?>;
	var sell_price = <?php echo isset($sell_price)?$sell_price:"";?>;
	
	
	function inputPointLost(){
		var nowpoint = $("#buyNums").val();
		nowpoint = parseInt(nowpoint / (minpoint / 100)) * (minpoint / 100) ;
		
		//对非数字 和 小于0 的数进行过滤
		if(nowpoint < 0 || isNaN(nowpoint)){
			nowpoint = 0;
		}
		
		//当输入的大于最大积分值  且   小于用户拥有的积分数 
		if(nowpoint > maxpoint && nowpoint <= userpoint){
			nowpoint = maxpoint;
		}
		
		//当输入的大于最大积分  且  大于用户积分
		if(nowpoint > maxpoint && nowpoint > userpoint){
			//console.log("in2");
			if(maxpoint > userpoint){
				nowpoint = userpoint;
			}else{
				nowpoint = maxpoint;
			}
		}
		//console.log("in3");
		//console.log("nowpoint is "+nowpoint);
		$("#buyNums").val(parseInt(nowpoint));
		
		//计算兑换积分后的价格
		var after_price =  parseInt(sell_price) - (parseInt(nowpoint) / parseInt(minpoint));
		console.log("结算后   "+after_price);
		
		console.log(nowpoint);
		// 用户剩余积分 = 用户积分 - 输入的分数 
		var u_point = parseInt(userpoint) - parseInt(nowpoint);
		
		//处理临界值
		if(u_point < 0 ){
			u_point = 0;
			nowpoint = userpoint;
			$("#buyNums").val(parseInt(nowpoint));
			
			var after_price =  parseInt(sell_price) - (parseInt(userpoint) / parseInt(minpoint));
			console.log("结算后   "+after_price);
			
		}else if(u_point > userpoint){
			//处理用户输入负数
			u_point = userpoint;
			$("#buyNums").val(0);
			
			//var after_price =  parseInt(sell_price) - (parseInt(userpoint) / parseInt(minpoint));
			//console.log("结算后   "+after_price);
		}
		
		if(nowpoint == 0){
			$("#data_sellPrice").html(after_price);
		}else{
			$("#data_sellPrice").html(after_price+"+"+nowpoint+"积分");
		}
		
		$(".userpoint").html(u_point);
		
	}
	
	function jifencommit(){
		/*
		*	1.获取用户兑换的积分
		*	2.获取商品id
		*	
		*/
		var nowjifen = $("#buyNums").val();
		var goodsId =  <?php echo isset($id)?$id:"";?>;
		window.location.href="index.php?controller=simple&action=cart2&id=<?php echo isset($id)?$id:"";?>&isjifen=1&num=1&type=goods&jifen="+nowjifen; 
	}

	//添加朋友
	function makeFriend(){
		var u_id = "<?php echo isset($this->user['user_id'])?$this->user['user_id']:"";?>";
		var u_name = "<?php echo isset($this->user['username'])?$this->user['username']:"";?>";
		
		/*
		if(!"<?php echo isset($seller['member_id'])?$seller['member_id']:"";?>"){
			var t_id = 1;
			var t_name = "米喀";
		}else{
			var t_id = "<?php echo isset($seller['member_id'])?$seller['member_id']:"";?>";
			var t_name = "<?php echo isset($seller['store_name'])?$seller['store_name']:"";?>";
		}*/
		
		var t_id = 1;
		var t_name = "米喀";
		
		var url = "<?php echo IUrl::creatUrl("");?>index.php?controller=chat&action=add";
		
		var formData = new FormData();
		formData.append("u_id",u_id);
		formData.append("u_name",u_name);
		formData.append("t_id",t_id);
		formData.append("t_name",t_name);
		
		
		var xhr = new XMLHttpRequest();
		xhr.responseType = "text"
		xhr.open("POST",url,true);
		xhr.onload = function(e){
			console.log(this.responseText);
			eval('var da='+this.responseText);
			///console.log(da.res);
			if(da.res == 1){
				console.log("== 1");
				$('dd[from_id='+t_id+'] a').click();
			}else{
				window.location.reload();
			}
		}
		xhr.send(formData);
	}
	
</script>






<!--主要模板内容 结束-->

<footer class="foot">
	<section class="service">
		<ul>
			<li class="item1">
				<i class="icon-star"></i>
				<strong>正品优选</strong>
			</li>
			<li class="item2">
				<i class="icon-globe"></i>
				<strong>上市公司</strong>
			</li>
			<li class="item3">
				<i class="icon-group"></i>
				<strong>300家连锁门店</strong>
			</li>
			<li class="item4">
				<i class="icon-plane"></i>
				<strong>长株潭次日达</strong>
			</li>
			<li class="item5">
				<i class="icon-gift"></i>
				<strong>满99包邮</strong>
			</li>
		</ul>
	</section>
	<section class="help">
		<?php $catIco = array('help-new','help-delivery','help-pay','help-user','help-service')?>
		<?php foreach(Api::run('getHelpCategoryFoot') as $key => $helpCat){?>
		<dl class="help_<?php echo $key+1;?>">
			<dt><?php echo isset($helpCat['name'])?$helpCat['name']:"";?></dt>
			<?php foreach(Api::run('getHelpListByCatidAll',array('#cat_id#',$helpCat['id'])) as $key => $item){?>
			<dd><a href="<?php echo IUrl::creatUrl("/site/help/id/".$item['id']."");?>"><?php echo isset($item['name'])?$item['name']:"";?></a></dd>
			<?php }?>
		</dl>
		<?php }?>
		<div class="contact">
			<em>400-888-8888</em>
			<span>周一到周日 8:00-18:00</span>
			<span>（仅收市话费）</span>
			<a href="#"><i class="icon-comments"></i> 24小时在线客服</a>
		</div>
	</section>
	<section class="copy">
		<?php echo IFilter::stripSlash($this->_siteConfig->site_footer_code);?>
	</section>
</footer>



</body>
</html>
<script>
//当首页时隐藏分类
<?php if(IWeb::$app->getController()->getId() == 'site' && IWeb::$app->getController()->getAction()->getId() == 'index'){?>
$('.cat_list').removeClass('none');
<?php }?>

$(function(){
	
	//$( "#date" ).datepicker();
	$('input:text[name="word"]').val("<?php echo $this->word;?>");
	
	//聊天
	$(".message").mouseover(function(){
		$(".right span").show();
	});
	
	$(".message").mouseout(function(){
		$(".right span").hide();
	});
	
	
	
	//响应拖拽
	var dh = $(".d_h");
	for(var i=0; i < dh.length; ++i){
		var dialog_header = dh[i];
		var flag = false;
		
		/*
		dialog_header.addEventListener('touchstart',function(){
			flag = true;
			var index = $(this).attr("value");
			test(flag,index-1);
		},false);
		
		
		dialog_header.addEventListener('touchend',function(){
			flag = false;
			var index = $(this).attr("value");
			test(flag,index-1);
		},false);
		*/
		
		dialog_header.ondragstart  = function(){
			flag = true;
			var index = $(this).attr("value");
			
			test(flag,index-1);
			
		}
		
		dialog_header.ondragend = function(){
			console.log("down");
			flag = false;
			var index = $(this).attr("value");
			test(flag,index-1);
		}
	}
	
	
	//console.log("dh is ");
	//console.log(dialog_header);
	//var dialog_header = document.getElementById("dialog_header");
	
	$(".close").click(function(){
		$(".chat_list").css("-webkit-transform","translateX(500px)");
	});
	
	$("#showFriend").click(function(){
		$(".chat_list").css("-webkit-transform","translateX(0px)");
	});
	
});

//拖动窗口响应
function test(flag,index){
	if(!flag){
		//document.getElementById("dialog").draggable = false;
		$(".msg-dialog")[index].draggable = false;
		return ;
	}
	//document.getElementById("dialog").draggable = true;
	var md = $(".msg-dialog");
	md[index].draggable = true;
	/*
	for(var i=0;i<md.length;++i){
		md[i].draggable = true;
	}*/
	//console.log(this);
	//$(".msg-dialog").html().draggable = true;
	//var dragdiv = document.querySelector(".msg-dialog");
	
	var dragdiv = md[index];
   	var x, y;  //记录到点击时鼠标到移动框左边和上边的距离

    dragdiv.addEventListener('dragstart', function (e) {
        e.dataTransfer.effectAllowed = "move";  //移动效果
        e.dataTransfer.setData("text", '');  //附加数据，　没有这一项，firefox中无法移动
        x = e.offsetX || e.layerX;
        y = e.offsetY || e.layerY;
        return true;
    }, false);

    document.addEventListener('dragover', function (e) {//取消冒泡 ,不取消则不能触发 drop事件
        e.preventDefault()|| e.stopPropagation();
    }, false);

    document.addEventListener('drop', function (e) {
        dragdiv.style.left = (e.pageX - x) + 'px';
        dragdiv.style.top = (e.pageY - y) + 'px';
        e.preventDefault() || e.stopPropagation();  //不取消，firefox中会触发网页跳转到查找setData中的内容
    }, false);
}


</script>
